import webapp2

from google.appengine.api import users


class Login(webapp2.RequestHandler):
  def get(self):
    assert users.get_current_user()
    return self.redirect('/')


class Logout(webapp2.RequestHandler):
  def get(self):
    # TODO(Flamingcow): XSRF protection
    return self.redirect(users.create_logout_url('/'))


app = webapp2.WSGIApplication([
  ('/user/login', Login),
  ('/user/logout', Logout),
])
